<html>
<head>
<meta charset="utf-8">
    <title>your resource</title>
    <script type="text/javascript" src="jquery.js"></script>
</head>
<body>
    <ul class="resource"> 
	<li class="1"> <button type="submit" class="btn" id="1">1</button></li>
		<li class="1"> <button type="submit" class="btn" id="2">2</button></li>
	</ul>
</body>
</html>

<script type="text/javascript">
    $.ajax({
        url:'http://116.62.24.202:8080/getResourceList',
        type:'post',
        datatype:'json',
        success:function(res){
		alert("123344");
            console.log(res);
           //将数据显示在页面上
             var str = "";
               str +="";
            //遍历数据
			$.each(res,function(index,element){
				str +="<li> <button type=\"submit\" class=btn>"+element+"</button></li>";
				});	
			$('.resource').append(str);
}});
$(document).on('click', '.btn', function() {
var msg=$(this).text();
    $.ajax({
        url:"http://116.62.24.202:8080/getResource",
        type:'post',
        datatype:'json',
		data: { filename: msg},
        success:function(res){
		alert("123344");}
		})
});


</script>